"use strict";

/*1.导包*/
import {Router} from  'express';

/*2.创建Rourer路由器*/
const router=Router();


export  const prefix="/";


/*
 * get/
 *
 * */

router.use((req,res,next)=>{
    const viewRoot="demo/";
    res.view=(name,data)=>{
        res.render(viewRoot+name,data)
    };
    next();
});


router.get('/demo',(req,res)=>{
    res.view('demo.hbs',{layout:'demo/layout'});

});



export default router;